"""_summary_

Returns:
    _type_: _description_
"""
import json

from app.common.response.response_schema import response_base
from app.core.conf import ST
from app.schemas.agv import RQAGVStatus
from fastapi import APIRouter, Depends, HTTPException

# 创建status router路由
status_router = APIRouter()


@status_router.post("/")
async def get_status(params: RQAGVStatus):
    # params.m_ip
    with open(ST.AGV_STATUS_PATH, "r", encoding="utf-8") as f:
        content = json.load(f)
    return response_base.response_200(msg="查询成功", data=content[params.m_ip])

